home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-12-10 | 8.3 KB | 306 lines | [TEXT/KAHL] |
- /***
- *
- * MacBob.r - Resource file for MacBob
- * Copyright © 1995 by Christopher E. Hyde. All rights reserved.
- *
- ***/
-
- #include <Types.r>
- #include <SysTypes.r>
-
- #define versString "1.0ß2"
- #define versNumbers 1, 0, beta, 2
- #define rBase 1000
- #define rHelp rBase+1000
- #define emptyRect {0, 0, 0, 0}
-
-
- #undef reserved
- #define reserved = 0
- type 'BBXF' { // BBEdit extension flags
- integer = 0;
- boolean reserved;
- boolean reserved;
- boolean reserved;
- boolean reserved;
- boolean reserved;
-
- boolean requiresPowerPC;
- boolean undoSavvy;
- boolean cantUndoAlert;
- boolean supportsNewInterface;
- boolean requiresNonEmptyWindow;
-
- boolean reserved; // Unused & Reserved (startup)
-
- boolean requiresChangeableWindow;
- boolean useOptionkeyForDefaults;
- boolean canBeUndone;
- boolean requiresSelection;
- boolean requiresEditWindow;
- };
-
- #define cmdKey 0x01
- #define shiftKey 0x02
- #define optionKey 0x08
- #define controlKey 0x10
-
- type 'DKey' { // Dialog key equivelents
- wide array {
- char; // fKey: Character code of keyboard key
- byte; // fItem: Number of dialog item to click
- byte anyDown = 0; // fModsOn: Modifier keys that must be on (down)
- byte anyUp = 0; // fModsOff: Modifier keys that must be off (up)
- // byte; // fPart: The item part to click
- };
- char = "\0x00";
- };
-
- resource 'BBXF' (20, "MacBob") {
- false, // requiresPowerPC
- true, // undoSavvy
- false, // cantUndoAlert
- false, // supportsNewInterface
- true, // requiresNonEmptyWindow
-
- false, // requiresChangeableWindow
- false, // useOptionkeyForDefaults
- false, // canBeUndone
- false, // requiresSelection
- true // requiresEditWindow
- };
-
-
- resource 'DLOG' (rBase, "Options", purgeable) {
- {60, 70, 288, 411},
- dBoxProc, visible, noGoAway,
- 0, rBase, ""
- };
-
- #define top 35
- #define left 30
- #define right 205
- #define CBRect(n) {top+(n*20), left, top+18+(n*20), right}
- #define Option(n, l) CBRect(n), Checkbox { enabled, l }
- #define ButtonW(x,y,n) {y, x, y+20, x+72}, Button { enabled, n }
- #define OButton(y,n) ButtonW(240, y, n)
-
- resource 'DITL' (rBase, "Options", purgeable) {
- {
- OButton(198, "Run"), // 1
- OButton(168, "Cancel"), // 2
- OButton(60, "About…"), // 3
- {3, 306, 35, 338}, Icon { enabled, rBase }, // 4
- {40, 214, 218, 216}, UserItem { disabled }, // 5
- Option(0, "Enable extensions"), // 6
- Option(1, "Verbose compile"), // 7
- Option(2, "Display generated code"), // 8
- // Option(3, "Buffer stderr"), // 9
- Option(3, "Buffer output"), // 9
- Option(4, "Verbose execution"), // 10
- Option(5, "Trace execution"), // 11
- Option(7, "Patch interpreter"), // 12
- Option(8, "Debug MacBob"), // 13
- {10, 10, 26, 100}, StaticText { disabled, "Options" },
- emptyRect, HelpItem { enabled, HMScanhdlg { rHelp } },
- emptyRect, HelpItem { enabled, HMScanhdlg { rHelp+1 } }
- }
- };
-
- resource 'DKey' (rBase) { // Key equivalents information
- {
- "R", 1, cmdKey, anyUp,
- ".", 2, cmdKey, anyUp,
- "A", 3, cmdKey, anyUp,
- "?", 4, cmdKey, anyUp,
-
- "E", 6, cmdKey, anyUp,
- "V", 7, cmdKey, anyUp,
- "D", 8, cmdKey, anyUp,
- "B", 9, cmdKey, anyUp,
- "X", 10, cmdKey, anyUp,
- "T", 11, cmdKey, anyUp,
- "P", 12, cmdKey, anyUp,
- "Z", 13, cmdKey, anyUp
- }
- };
-
-
- resource 'DLOG' (rBase+1, "About…", purgeable) {
- {0, 0, 250, 380},
- dBoxProc, visible, noGoAway,
- 0, rBase+1, ""
- };
-
- #define left 40
- #define right 340
-
- resource 'DITL' (rBase+1, "About…") {
- {
- // 1
- {220, 150, 240, 230},
- Button { enabled, "OK" },
- // 2
- {20, 75, 44, right},
- // StaticText { disabled, "MacBob " versString },
- StaticText { disabled, "MacBob " versString "\n" $$Date " " $$Time },
- // 3
- {60+8, left, 72+8, right},
- StaticText { disabled, "Original Bob code written by David Michael Betz, © 1991." },
- // 4
- {88+4, left, 100+4, right},
- StaticText { disabled, "MacBob code written by Christopher E. Hyde, © 1995." },
- // 5
- {116, left, 210, right},
- StaticText { disabled, "This extension is shareware, as is the source code. "
- "Feel free to send money comments or questions to Christopher E. Hyde at:\n"
- "\n\n\n\nemail: drjekyll@hylight.demon.co.uk." },
- // 6
- {146, left+31, 182, right},
- StaticText { disabled,
- "25 Carson Road\n"
- "London E16 4BD\n"
- "England (UK)" },
- // 7
- {10, 20, 42, 52},
- Icon { disabled, rBase+10 },
- // 8
- // {52, 20, 53, 360},
- {52, 20, 54, 360},
- UserItem { disabled }
- }
- };
-
-
- resource 'DLOG' (rBase+2, "Stop Alert") {
- {60, 40, 161, 440},
- dBoxProc, visible, goAway,
- 0, rBase+2, ""
- };
-
- resource 'DITL' (rBase+2, "Stop Alert") {
- {
- {71, 330, 91, 390}, Button { enabled, "OK" },
- {10, 75, 55, 390}, StaticText { disabled, "^0" },
- {10, 20, 42, 52}, Icon { disabled, 0 }
- }
- };
-
-
- resource 'vers' (1) {
- versNumbers,
- verBritain,
- versString,
- // versString ", © 1995 by Christopher E. Hyde. All rights reserved."
- versString ", by Christopher E. Hyde\n© 1995. All rights reserved."
- };
-
- resource 'vers' (2) {
- versNumbers,
- verBritain,
- versString,
- "A BBEdit Extension"
- };
-
- resource 'STR ' (-16397, "Double-click String", purgeable) {
- "BBEdit extension\n\n"
- "You cannot open this extension directly, but if you put it in "
- "your ‘BBEdit Extensions’ folder, you will be able to select it "
- "from the ‘Extensions’ menu when running BBEdit or BBEdit Lite."
- };
-
-
- resource 'STR#' (rBase, "Error Messages") {
- {
- "MacBob can only run if used with BBEdit (or BBEdit Lite) version 2.0 or later.";
- "MacBob cannot run on this kind of window. Try opening a regular document.";
- "Execution of the MacBob program has been interrupted.";
- "Balloon Help is only available if you are running System 7.0 or later.";
- "MacBob could not get the window contents from BBEdit. "
- "Try restarting the application.";
- "MacBob could not allocate enough memory. "
- "Try closing some documents or quitting other running applications.";
- "MacBob cannot find the function ‘main’.";
- "Too much recursion during garbage collection. Out of stack space.";
- "MacBob has encountered an error of unknown origin. "
- "Please contact a reputable etymologist.";
- }
- };
-
- resource 'STR#' (rBase+1, "Token Names") {
- {
- "<string>", "<identifier>", "<number>",
- "class", "static", "if", "else",
- "while", "return", "for", "break",
- "continue", "do", "new", "nil",
- "<=", "==", "!=", ">=",
- "<<", ">>", "&&", "||",
- "++", "--",
- "+=", "-=", "*=", "/=",
- "%=", "&=", "|=", "^=",
- "<<=", ">>=", "::", "->"
- }
- };
-
-
- // ==========================================================================================
-
-
- #include <BalloonTypes.r>
-
- #define rHelpStrs rHelp
- #define noHelpStr 0, 0
- #define zeroPt {0, 0}
- #define leftEdge {8, 1}
-
- #define HelpStr(n) rHelpStrs, n
- #define ButtonHelp(n) HMStringResItem { zeroPt, emptyRect, HelpStr(n), noHelpStr, noHelpStr, noHelpStr }
- #define CheckBoxHelp(n) HMStringResItem { leftEdge, emptyRect, HelpStr(n), noHelpStr, HelpStr(n), noHelpStr }
-
- resource 'hdlg' (rHelp, "Balloon Help 1", purgeable) {
- HelpMgrVersion, 0,
- hmDefaultOptions, 0, 0,
- HMSkipItem {}, {
- ButtonHelp(1),
- ButtonHelp(2),
- ButtonHelp(3),
- ButtonHelp(4)
- }
- };
-
- resource 'hdlg' (rHelp+1, "Balloon Help 2", purgeable) {
- HelpMgrVersion, 5,
- hmDefaultOptions, 0, 3,
- HMSkipItem {}, {
- CheckBoxHelp(5),
- CheckBoxHelp(6),
- CheckBoxHelp(7),
- CheckBoxHelp(8),
- CheckBoxHelp(9),
- CheckBoxHelp(10),
- CheckBoxHelp(11),
- CheckBoxHelp(12)
- }
- };
-
-
- resource 'STR#' (rHelpStrs, "Balloon Help Strings") {
- {
- "Compile and run the program in the front window. ∞R";
- "Close the dialog box without compiling and running the program. ∞.";
- "Display information about this version of MacBob. ∞A";
- "Toggle balloon help on and off. ∞?";
- "Enable the MacBob extensions to the Bob programming language. ∞E";
- "Print messages to the output window while compiling. ∞V";
- "Display in the output window the opcodes for each function compiled. ∞D";
- // "Buffer output to stderr. This increases the speed of error printing. ∞B";
- "Buffer output. This increases the speed of printing. ∞B";
- "Print messages to the output window while running the MacBob program. ∞X";
- "Trace the execution of the MacBob program. ∞T";
- "Patch the actual machine code of the MacBob interpreter function. "
- "This can give up to a 3 fold speed increase. ∞P";
- "Debug the internals of MacBob. "
- "Only really useful if you have modified the source code. ∞Z";
- }
- };
-